package cn.com.nes.common.em;

import lombok.Getter;

@Getter
public enum EquipmentDamageLevelEnum {

    /**
     * 未检查
     */
    _0(0, ""),
    /**
     * 无损坏
     */
    _1(1, "设备正常"),
    /**
     * 设备过水
     */
    _2(2, "设备过水"),
    /**
     * 设备泡水
     */
    _3(3, "设备泡水"),
    /**
     * 设备损坏
     */
    _4(4, "设备损坏");

    private final Integer level;

    private final String name;

    EquipmentDamageLevelEnum(Integer level, String name) {
        this.level = level;
        this.name = name;
    }

    public static EquipmentDamageLevelEnum getEnumByLevel(Integer level) {
        for (EquipmentDamageLevelEnum e : EquipmentDamageLevelEnum.values()) {
            if (e.getLevel().equals(level)) {
                return e;
            }
        }
        return null;
    }

}
